+2000-11-12 Havoc Pennington <hp@pobox.com>
+
+ * demos/gtk-demo/Makefile.am (democodedir): change demo install
+ dir to datadir/gtk+-2.0/demo
+
+ * demos/gtk-demo/textview.c: Text widget demo; reveals all
+ sorts of text widget and Pango font bugs. Urgh.
+
+ * demos/gtk-demo/Makefile.am (demos): Add textview.c
+
+ * demos/gtk-demo/main.c (create_tree): Add instructions at top of
+ tree that you should double click to see the demo. Fix
+ types of variables to reflect changed return values from
+ GtkTreeStore and GtkTreeViewColumn constructors.
+
+ * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
+ newly-created buffer to prepare for GObject semantics
+
+ * gtk/testtext.c: don't leak the buffer with GObject semantics
+
+ * gtk/testtextbuffer.c: ditto
+
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
+2000-11-12 Havoc Pennington <hp@pobox.com>
+
+ * demos/gtk-demo/Makefile.am (democodedir): change demo install
+ dir to datadir/gtk+-2.0/demo
+
+ * demos/gtk-demo/textview.c: Text widget demo; reveals all
+ sorts of text widget and Pango font bugs. Urgh.
+
+ * demos/gtk-demo/Makefile.am (demos): Add textview.c
+
+ * demos/gtk-demo/main.c (create_tree): Add instructions at top of
+ tree that you should double click to see the demo. Fix
+ types of variables to reflect changed return values from
+ GtkTreeStore and GtkTreeViewColumn constructors.
+
+ * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
+ newly-created buffer to prepare for GObject semantics
+
+ * gtk/testtext.c: don't leak the buffer with GObject semantics
+
+ * gtk/testtextbuffer.c: ditto
+
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
+2000-11-12 Havoc Pennington <hp@pobox.com>
+
+ * demos/gtk-demo/Makefile.am (democodedir): change demo install
+ dir to datadir/gtk+-2.0/demo
+
+ * demos/gtk-demo/textview.c: Text widget demo; reveals all
+ sorts of text widget and Pango font bugs. Urgh.
+
+ * demos/gtk-demo/Makefile.am (demos): Add textview.c
+
+ * demos/gtk-demo/main.c (create_tree): Add instructions at top of
+ tree that you should double click to see the demo. Fix
+ types of variables to reflect changed return values from
+ GtkTreeStore and GtkTreeViewColumn constructors.
+
+ * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
+ newly-created buffer to prepare for GObject semantics
+
+ * gtk/testtext.c: don't leak the buffer with GObject semantics
+
+ * gtk/testtextbuffer.c: ditto
+
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
+2000-11-12 Havoc Pennington <hp@pobox.com>
+
+ * demos/gtk-demo/Makefile.am (democodedir): change demo install
+ dir to datadir/gtk+-2.0/demo
+
+ * demos/gtk-demo/textview.c: Text widget demo; reveals all
+ sorts of text widget and Pango font bugs. Urgh.
+
+ * demos/gtk-demo/Makefile.am (demos): Add textview.c
+
+ * demos/gtk-demo/main.c (create_tree): Add instructions at top of
+ tree that you should double click to see the demo. Fix
+ types of variables to reflect changed return values from
+ GtkTreeStore and GtkTreeViewColumn constructors.
+
+ * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
+ newly-created buffer to prepare for GObject semantics
+
+ * gtk/testtext.c: don't leak the buffer with GObject semantics
+
+ * gtk/testtextbuffer.c: ditto
+
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
+2000-11-12 Havoc Pennington <hp@pobox.com>
+
+ * demos/gtk-demo/Makefile.am (democodedir): change demo install
+ dir to datadir/gtk+-2.0/demo
+
+ * demos/gtk-demo/textview.c: Text widget demo; reveals all
+ sorts of text widget and Pango font bugs. Urgh.
+
+ * demos/gtk-demo/Makefile.am (demos): Add textview.c
+
+ * demos/gtk-demo/main.c (create_tree): Add instructions at top of
+ tree that you should double click to see the demo. Fix
+ types of variables to reflect changed return values from
+ GtkTreeStore and GtkTreeViewColumn constructors.
+
+ * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
+ newly-created buffer to prepare for GObject semantics
+
+ * gtk/testtext.c: don't leak the buffer with GObject semantics
+
+ * gtk/testtextbuffer.c: ditto
+
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
+2000-11-12 Havoc Pennington <hp@pobox.com>
+
+ * demos/gtk-demo/Makefile.am (democodedir): change demo install
+ dir to datadir/gtk+-2.0/demo
+
+ * demos/gtk-demo/textview.c: Text widget demo; reveals all
+ sorts of text widget and Pango font bugs. Urgh.
+
+ * demos/gtk-demo/Makefile.am (demos): Add textview.c
+
+ * demos/gtk-demo/main.c (create_tree): Add instructions at top of
+ tree that you should double click to see the demo. Fix
+ types of variables to reflect changed return values from
+ GtkTreeStore and GtkTreeViewColumn constructors.
+
+ * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
+ newly-created buffer to prepare for GObject semantics
+
+ * gtk/testtext.c: don't leak the buffer with GObject semantics
+
+ * gtk/testtextbuffer.c: ditto
+
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
+2000-11-12 Havoc Pennington <hp@pobox.com>
+
+ * demos/gtk-demo/Makefile.am (democodedir): change demo install
+ dir to datadir/gtk+-2.0/demo
+
+ * demos/gtk-demo/textview.c: Text widget demo; reveals all
+ sorts of text widget and Pango font bugs. Urgh.
+
+ * demos/gtk-demo/Makefile.am (demos): Add textview.c
+
+ * demos/gtk-demo/main.c (create_tree): Add instructions at top of
+ tree that you should double click to see the demo. Fix
+ types of variables to reflect changed return values from
+ GtkTreeStore and GtkTreeViewColumn constructors.
+
+ * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
+ newly-created buffer to prepare for GObject semantics
+
+ * gtk/testtext.c: don't leak the buffer with GObject semantics
+
+ * gtk/testtextbuffer.c: ditto
+
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
## Makefile.am for gtk+/demos
-democodedir=$(datadir)/gtk-demo
+democodedir=$(datadir)/gtk-2.0/demo
demos = @STRIP_BEGIN@ \
button_box.c \
item_factory.c \
menus.c \
panes.c \
+ textview.c \
@STRIP_END@
INCLUDES = @STRIP_BEGIN@ \
GtkTreeSelection *selection;
GtkCellRenderer *cell;
GtkWidget *tree_view;
- GtkObject *column;
- GtkObject *model;
+ GtkTreeViewColumn *column;
+ GtkTreeStore *model;
GtkTreeIter iter;
gint i;
}
cell = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes ("Widget",
+ column = gtk_tree_view_column_new_with_attributes ("Widget (double click for demo)",
cell,
"text", TITLE_COLUMN,
"italic", ITALIC_COLUMN,
gtk_object_sink (GTK_OBJECT (text_buffer->tag_table));
}
+ gtk_object_ref (GTK_OBJECT (text_buffer));
+ gtk_object_sink (GTK_OBJECT (text_buffer));
+
return text_buffer;
}
/* You can either ignore the return value, or use it to
* set the attributes of the tag. tag_name can be NULL
*/
+/* FIXME this should take a varargs list of tag attributes I think */
GtkTextTag *gtk_text_buffer_create_tag (GtkTextBuffer *buffer,
const gchar *tag_name);
text_view = GTK_TEXT_VIEW (widget);
gtk_text_view_paint (widget, area);
-
+
/* If the area overlaps the "edge" of the widget, draw the focus
* rectangle
*/
(area->x + area->width) > (widget->allocation.width - FOCUS_EDGE_WIDTH) ||
(area->y + area->height) > (widget->allocation.height - FOCUS_EDGE_WIDTH))
gtk_widget_draw_focus (widget);
-
+
/* Synthesize expose events for the user-drawn border windows,
* just as we would for a drawing area.
*/
static gint
gtk_text_view_expose_event (GtkWidget *widget, GdkEventExpose *event)
-{
+{
if (event->window == gtk_text_view_get_window (GTK_TEXT_VIEW (widget),
GTK_TEXT_WINDOW_TEXT))
gtk_text_view_paint (widget, &event->area);
if (event->window == widget->window)
gtk_widget_draw_focus (widget);
-
+
return TRUE;
}
buffer = gtk_text_buffer_new (NULL);
- /* FIXME memory leak once buffer is a GObject */
search_text = gtk_text_view_new_with_buffer (buffer);
+ g_object_unref (G_OBJECT (buffer));
+
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
search_text,
TRUE, TRUE, 0);
buffer = g_new (Buffer, 1);
buffer->buffer = gtk_text_buffer_new (NULL);
- gtk_object_ref (GTK_OBJECT (buffer->buffer));
- gtk_object_sink (GTK_OBJECT (buffer->buffer));
buffer->refcount = 1;
buffer->filename = NULL;
run_tests (buffer);
+ g_object_unref (G_OBJECT (buffer));
+
g_print ("All tests passed.\n");
return 0;
buffer = gtk_text_buffer_new (NULL);
- /* FIXME memory leak once buffer is a GObject */
search_text = gtk_text_view_new_with_buffer (buffer);
+ g_object_unref (G_OBJECT (buffer));
+
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
search_text,
TRUE, TRUE, 0);
buffer = g_new (Buffer, 1);
buffer->buffer = gtk_text_buffer_new (NULL);
- gtk_object_ref (GTK_OBJECT (buffer->buffer));
- gtk_object_sink (GTK_OBJECT (buffer->buffer));
buffer->refcount = 1;
buffer->filename = NULL;
run_tests (buffer);
+ g_object_unref (G_OBJECT (buffer));
+
g_print ("All tests passed.\n");
return 0;